/**
 * IndexCtrl.java   2017年4月14日 下午4:46:27 by xuebing 
 *
 * Copyright (c) 2010 - 2017 All rights reserved.
 * 
 */
package com.rongmai.web.ctrl;

import com.rongmai.db.model.BaseResult;
import com.rongmai.web.bo.OssFileBo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/ossfile")
public class OssFileCtrl {

    @Resource
    private OssFileBo ossFileBo;

    @RequestMapping(value="/upload", method = RequestMethod.POST)
    public BaseResult<String> upload(@RequestParam("file") MultipartFile file) {
        return BaseResult.succ(ossFileBo.upload(file));
    }
}
